package com.bafa.dbcache;

import com.bafa.objects.Match;
import com.bafa.objects.player.Player;
import com.bafa.objects.season.Season;

public class CacheUtils {

	public static void storeMatch(Match match){
		if(LeagueCache.getMatches().containsKey(match.getID())){
			LeagueCache.getMatches().remove(match.getID());
        }
        
		LeagueCache.getMatches().put(match.getID(),match);
	}
	
	public static void storePlayer(Player player){
        if(LeagueCache.getPlayers().containsKey(player.getFirstname())){
            LeagueCache.getPlayers().remove(player.getFirstname());
        }
        
        LeagueCache.getPlayers().put(player.getFirstname(),player);
    }
	
	public static void storeSeason(Season season){
        if(GrabSeasons.getSeasons().containsKey(season.getId())){
			GrabSeasons.getSeasons().remove(season.getId());
        }
        
		GrabSeasons.getSeasons().put(season.getId(),season);
    }
	
}
